package com.zhoujing.cinema.backend.controller;

import com.github.pagehelper.PageInfo;
import com.zhoujing.cinema.backend.controller.VO.Actor;
import com.zhoujing.cinema.backend.controller.VO.Data;
import com.zhoujing.cinema.backend.controller.VO.MovieVo;
import com.zhoujing.cinema.constants.Constant;
import com.zhoujing.cinema.entity.*;
import com.zhoujing.cinema.service.CinemaService;
import com.zhoujing.cinema.service.MovieService;
import com.zhoujing.cinema.utils.ResponseResult;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.multipart.MultipartResolver;
import org.springframework.web.multipart.commons.CommonsMultipartResolver;

import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.lang.reflect.InvocationTargetException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.UUID;

@Controller
@RequestMapping("/backend/movie")
public class MovieController {
    @Autowired
    public MovieService movieService;
    @Autowired
    public CinemaService cinemaService;
    @RequestMapping("/movieAdd")
    public String movieAdd(Model model){
        List<Type> listType = movieService.findType();
        List<Year> listYear = movieService.findYear();
        List<Country> listCountry = movieService.findCountry();
        model.addAttribute("types",listType);
        model.addAttribute("areas",listCountry);
        model.addAttribute("years",listYear);
        return "movieAdd";
    }
    @ResponseBody
    @RequestMapping("/addMovie")
    public ResponseResult addMovie(HttpServletRequest request){
        MultipartResolver resolver = new CommonsMultipartResolver(request.getSession().getServletContext());
        MultipartHttpServletRequest mreq = resolver.resolveMultipart(request);
        Movie movie = new Movie();
        ResponseResult responseResult = new ResponseResult();
        MultipartFile file = mreq.getFile("avatar");
        MultipartFile file1 = mreq.getFile("avatar1");
        MultipartFile file2 = mreq.getFile("avatar2");
        MultipartFile file3 = mreq.getFile("avatar3");
        MultipartFile file4 = mreq.getFile("avatar4");
        MultipartFile file5 = mreq.getFile("avatar5");
        String name = mreq.getParameter("name");
        movie.setName(name);
        String ename = mreq.getParameter("ename");
        movie.setEname(ename);
        String type = mreq.getParameter("type");
        movie.setType(type);
        Integer area = Integer.parseInt(mreq.getParameter("area"));
        movie.setDistrict(area);
        Integer year = Integer.parseInt(mreq.getParameter("year"));
        movie.setYears(year);
        String time = mreq.getParameter("time");
        movie.setTime(time);
        String duration = mreq.getParameter("duration");
        movie.setDuration(duration);
        String desc = mreq.getParameter("desc");
        movie.setDesc(desc);
        String effect = mreq.getParameter("effect");
        movie.setEffect(effect);
        String director = mreq.getParameter("director");
        movie.setDirector(director);
        Integer mov_type = Integer.parseInt(mreq.getParameter("mov_type"));
        movie.setMov_type(mov_type);
        String actor1 = mreq.getParameter("actor1");
        String actor2 = mreq.getParameter("actor2");
        String actor3 = mreq.getParameter("actor3");
        String actor4 = mreq.getParameter("actor4");
        String actorRole1 = mreq.getParameter("actorRole1");
        String actorRole2 = mreq.getParameter("actorRole2");
        String actorRole3 = mreq.getParameter("actorRole3");
        String actorRole4 = mreq.getParameter("actorRole4");
        String actor = actor1+"/"+actorRole1+","+actor2+"/"+actorRole2+","+actor3+"/"+actorRole3+","+actor4+"/"+actorRole4;
        movie.setActor(actor);
        movie.setWant_count(String.valueOf(0));
        movie.setScore(String.valueOf(0));
        movie.setBooking(String.valueOf(0));
        String fileName = file.getOriginalFilename();
        //上传图片
        String newFileName = UUID.randomUUID() + fileName.substring(fileName.lastIndexOf("."));
        String avatars = "http://127.0.0.1:8088/basic/" + newFileName;
        movie.setCover(avatars);
        try {
            File fileMkdir = new File("D:\\images\\basic");
            if (!fileMkdir.exists()) {
                fileMkdir.mkdir();
            }
            //定义输出流 将文件保存在D盘    file.getOriginalFilename()为获得文件的名字
            FileOutputStream os = new FileOutputStream(fileMkdir.getPath() + "\\" + newFileName);
            InputStream in = file.getInputStream();
            int b = 0;
            while ((b = in.read()) != -1) { //读取文件
                os.write(b);
            }
            os.flush(); //关闭流
            in.close();
            os.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
        //1
        String fileName1 = file1.getOriginalFilename();
        //上传图片
        String newFileName1 = UUID.randomUUID() + fileName1.substring(fileName1.lastIndexOf("."));
        String avatars1 = "http://127.0.0.1:8088/basic/" + newFileName1;
        movie.setCover(avatars);
        try {
            File fileMkdir = new File("D:\\images\\basic");
            if (!fileMkdir.exists()) {
                fileMkdir.mkdir();
            }
            //定义输出流 将文件保存在D盘    file.getOriginalFilename()为获得文件的名字
            FileOutputStream os = new FileOutputStream(fileMkdir.getPath() + "\\" + newFileName1);
            InputStream in = file1.getInputStream();
            int b = 0;
            while ((b = in.read()) != -1) { //读取文件
                os.write(b);
            }
            os.flush(); //关闭流
            in.close();
            os.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
        //2
        String fileName2 = file2.getOriginalFilename();
        //上传图片
        String newFileName2 = UUID.randomUUID() + fileName2.substring(fileName2.lastIndexOf("."));
        String avatars2 = "http://127.0.0.1:8088/basic/" + newFileName2;
        try {
            File fileMkdir = new File("D:\\images\\basic");
            if (!fileMkdir.exists()) {
                fileMkdir.mkdir();
            }
            //定义输出流 将文件保存在D盘    file.getOriginalFilename()为获得文件的名字
            FileOutputStream os = new FileOutputStream(fileMkdir.getPath() + "\\" + newFileName2);
            InputStream in = file2.getInputStream();
            int b = 0;
            while ((b = in.read()) != -1) { //读取文件
                os.write(b);
            }
            os.flush(); //关闭流
            in.close();
            os.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
        //3
        String fileName3 = file3.getOriginalFilename();
        //上传图片
        String newFileName3 = UUID.randomUUID() + fileName3.substring(fileName3.lastIndexOf("."));
        String avatars3 = "http://127.0.0.1:8088/basic/" + newFileName3;
        try {
            File fileMkdir = new File("D:\\images\\basic");
            if (!fileMkdir.exists()) {
                fileMkdir.mkdir();
            }
            //定义输出流 将文件保存在D盘    file.getOriginalFilename()为获得文件的名字
            FileOutputStream os = new FileOutputStream(fileMkdir.getPath() + "\\" + newFileName3);
            InputStream in = file3.getInputStream();
            int b = 0;
            while ((b = in.read()) != -1) { //读取文件
                os.write(b);
            }
            os.flush(); //关闭流
            in.close();
            os.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
        //4
        String fileName4 = file4.getOriginalFilename();
        //上传图片
        String newFileName4 = UUID.randomUUID() + fileName4.substring(fileName4.lastIndexOf("."));
        String avatars4 = "http://127.0.0.1:8088/basic/" + newFileName4;
        try {
            File fileMkdir = new File("D:\\images\\basic");
            if (!fileMkdir.exists()) {
                fileMkdir.mkdir();
            }
            //定义输出流 将文件保存在D盘    file.getOriginalFilename()为获得文件的名字
            FileOutputStream os = new FileOutputStream(fileMkdir.getPath() + "\\" + newFileName4);
            InputStream in = file4.getInputStream();
            int b = 0;
            while ((b = in.read()) != -1) { //读取文件
                os.write(b);
            }
            os.flush(); //关闭流
            in.close();
            os.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
        //5
        String fileName5 = file4.getOriginalFilename();
        //上传图片
        String newFileName5 = UUID.randomUUID() + fileName5.substring(fileName5.lastIndexOf("."));
        String avatars5 = "http://127.0.0.1:8088/basic/" + newFileName5;
        movie.setCover(avatars);
        try {
            File fileMkdir = new File("D:\\images\\basic");
            if (!fileMkdir.exists()) {
                fileMkdir.mkdir();
            }
            //定义输出流 将文件保存在D盘    file.getOriginalFilename()为获得文件的名字
            FileOutputStream os = new FileOutputStream(fileMkdir.getPath() + "\\" + newFileName5);
            InputStream in = file5.getInputStream();
            int b = 0;
            while ((b = in.read()) != -1) { //读取文件
                os.write(b);
            }
            os.flush(); //关闭流
            in.close();
            os.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
        String pics = avatars1+","+avatars2+","+avatars3+","+avatars4+","+avatars5;
        movie.setPics(pics);
        movieService.insertMovie(movie);
        responseResult.setMessage("添加成功");
        responseResult.setStatus(Constant.RESPONSE_STATUS_SUCCESS);
        return responseResult;
    }
    @RequestMapping("/movieEdit")
    public String movieEdit(Model model,Integer pageNum){
        if(ObjectUtils.isEmpty(pageNum)){
            pageNum=Constant.PAGE_NUM;
        }
        PageInfo<Movie> movies = movieService.selectAllMovie(pageNum,Constant.PAGE_SIZE);
        model.addAttribute("movies",movies);
        List<Type> listType = movieService.findType();
        List<Year> listYear = movieService.findYear();
        List<Country> listCountry = movieService.findCountry();
        model.addAttribute("types",listType);
        model.addAttribute("areas",listCountry);
        model.addAttribute("years",listYear);
        return "movieEdit";
    }
    @RequestMapping("/searchMovie" )
    @ResponseBody
    public ResponseResult searchMovie(Integer pageNum,String username){
        ResponseResult responseResult = new ResponseResult();
        if(ObjectUtils.isEmpty(pageNum)){
            pageNum=Constant.PAGE_NUM;
        }
        PageInfo<Movie> user = movieService.findMovieSearch(username,pageNum,Constant.PAGE_SIZE);
        responseResult.setData(user);
        responseResult.setMessage("查询成功");
        responseResult.setStatus(Constant.RESPONSE_STATUS_SUCCESS);
        return responseResult;
        //System.out.println(username+password);
    }
    @RequestMapping("/{id}")
    @ResponseBody
    public ResponseResult getMovieById(@PathVariable Integer id) throws InvocationTargetException, IllegalAccessException {
        Movie movie = movieService.selectMovieByIds(id);
        MovieVo movieVo = new MovieVo();
        BeanUtils.copyProperties(movie,movieVo);
        movieVo.setCountryName(String.valueOf(movie.getCountry().getCountry_id()));
        movieVo.setYearName(String.valueOf(movie.getYear().getYear_id()));
        movieVo.setTypeName(String.valueOf(movie.getMovieType().getMov_type_id()));
        String[] arr = movie.getPics().split(",");
        movieVo.setDirectorPic(arr[0]);
        ArrayList<String> arrPic = new ArrayList<String>();
        for(int i=0;i<=arr.length-1;i++){
            arrPic.add(i,arr[i]);
        }
        arrPic.remove(0);
        String actor[] = movie.getActor().split(",");
        String types[] = movie.getType().split(",");
        movieVo.setTypes(types);
        ArrayList<String> arrName = new ArrayList<String>();
        ArrayList<String> arrRoleName= new ArrayList<String>();
        for(int i = 0;i<=actor.length-1;i++){
            String arrActorName[] = actor[i].split("/");
            arrName.add(i,arrActorName[0]);
            arrRoleName.add(i,arrActorName[1]);
        }
        List<Actor> list = new ArrayList<>();
        for (int i =0;i<=actor.length-1;i++){
            Actor actor1 = new Actor(arrName.get(i),arrRoleName.get(i),arrPic.get(i));
            list.add(actor1);
        }
        movieVo.setActors(list);
        ResponseResult responseResult = new ResponseResult();
        responseResult.setData(movieVo);
        responseResult.setStatus(Constant.RESPONSE_STATUS_SUCCESS);
        responseResult.setMessage("查询成功");
        return responseResult;
    }
    @ResponseBody
    @RequestMapping("/updateMovie")
    public ResponseResult updateMovie(HttpServletRequest request){
        MultipartResolver resolver = new CommonsMultipartResolver(request.getSession().getServletContext());
        MultipartHttpServletRequest mreq = resolver.resolveMultipart(request);
        Movie movie = new Movie();
        ResponseResult responseResult = new ResponseResult();
        String id = mreq.getParameter("id");
        movie.setId(Integer.parseInt(id));
        String name = mreq.getParameter("name");
        movie.setName(name);
        String ename = mreq.getParameter("ename");
        movie.setEname(ename);
        String type = mreq.getParameter("type");
        movie.setType(type);
        Integer area = Integer.parseInt(mreq.getParameter("area"));
        movie.setDistrict(area);
        Integer year = Integer.parseInt(mreq.getParameter("year"));
        movie.setYears(year);
        String time = mreq.getParameter("time");
        movie.setTime(time);
        String duration = mreq.getParameter("duration");
        movie.setDuration(duration);
        String desc = mreq.getParameter("desc");
        movie.setDesc(desc);
        String effect = mreq.getParameter("effect");
        movie.setEffect(effect);
        String director = mreq.getParameter("director");
        movie.setDirector(director);
        Integer mov_type = Integer.parseInt(mreq.getParameter("mov_type"));
        movie.setMov_type(mov_type);
        String actor1 = mreq.getParameter("actor1");
        String actor2 = mreq.getParameter("actor2");
        String actor3 = mreq.getParameter("actor3");
        String actor4 = mreq.getParameter("actor4");
        String actorRole1 = mreq.getParameter("actorRole1");
        String actorRole2 = mreq.getParameter("actorRole2");
        String actorRole3 = mreq.getParameter("actorRole3");
        String actorRole4 = mreq.getParameter("actorRole4");
        String actor = actor1+"/"+actorRole1+","+actor2+"/"+actorRole2+","+actor3+"/"+actorRole3+","+actor4+"/"+actorRole4;
        movie.setActor(actor);
        movie.setWant_count(String.valueOf(0));
        movie.setScore(String.valueOf(0));
        movie.setBooking(String.valueOf(0));
        movieService.updateMovie(movie);
        responseResult.setMessage("添加成功");
        responseResult.setStatus(Constant.RESPONSE_STATUS_SUCCESS);
        return responseResult;
    }
    @RequestMapping("cinemaEdit")
    public String cinemaEdit(Model model,Integer pageNum){
        List<City> cityList = cinemaService.findAllCity();
        if(ObjectUtils.isEmpty(pageNum)){
            pageNum=Constant.PAGE_NUM;
        }
        PageInfo<Cinema> list = cinemaService.findCinemas(pageNum,Constant.PAGE_SIZE);
        model.addAttribute("cinemas",list);
        model.addAttribute("citys",cityList);
        return "cinemaEdit";
    }
    @RequestMapping("/searchCinema" )
    @ResponseBody
    public ResponseResult searchCinema(Integer pageNum,String username){
        ResponseResult responseResult = new ResponseResult();
        if(ObjectUtils.isEmpty(pageNum)){
            pageNum=Constant.PAGE_NUM;
        }
        PageInfo<Cinema> user = cinemaService.searchCinemas(username,pageNum,Constant.PAGE_SIZE);
        responseResult.setData(user);
        responseResult.setMessage("查询成功");
        responseResult.setStatus(Constant.RESPONSE_STATUS_SUCCESS);
        return responseResult;
        //System.out.println(username+password);
    }
    @RequestMapping("/cinemaAdd" )
    public String cinemaAdd(Model model){
        List<City> cityList = cinemaService.findAllCity();
//        List<CinemaBrand> list1 = cinemaService.findCinemaBrand(cityId);
//        List<CinemaArea> list2 = cinemaService.findCinemaArea(cityId);
//        List<CinemaType> list3 = cinemaService.findCinemaType(cityId);
//        model.addAttribute("data1",list1);
//        model.addAttribute("data2",list2);
//        model.addAttribute("data3",list3);
        model.addAttribute("citys",cityList);
        return "cinemaAdd";
    }
    @RequestMapping("/data" )
    @ResponseBody
    public ResponseResult data(Model model,Integer id){
        ResponseResult responseResult = new ResponseResult();
        Data data = new Data();
        List<CinemaBrand> list1 = cinemaService.findCinemaBrand(id);
        List<CinemaArea> list2 = cinemaService.findCinemaArea(id);
        List<CinemaType> list3 = cinemaService.findCinemaType(id);
        data.setCinemaAreaList(list2);
        data.setCinemaBrandList(list1);
        data.setCinemaTypeList(list3);
        responseResult.setData(data);
        return responseResult;
    }
    @ResponseBody
    @RequestMapping("/addCinema")
    public ResponseResult addCinema(HttpServletRequest request){
        MultipartResolver resolver = new CommonsMultipartResolver(request.getSession().getServletContext());
        MultipartHttpServletRequest mreq = resolver.resolveMultipart(request);
        Cinema cinema = new Cinema();
        ResponseResult responseResult = new ResponseResult();
        MultipartFile file = mreq.getFile("avatar");
        String name = mreq.getParameter("name");
        cinema.setName(name);
        String type = mreq.getParameter("type");
        cinema.setType(type);
        Integer area = Integer.parseInt(mreq.getParameter("area"));
        cinema.setArea(area);
        Integer city = Integer.parseInt(mreq.getParameter("city"));
        cinema.setCitys(city);
        Integer brand = Integer.parseInt(mreq.getParameter("brand"));
        cinema.setBrand(brand);
        String time = mreq.getParameter("address");
        cinema.setAddress(time);
        String duration = mreq.getParameter("phone");
        cinema.setPhone(duration);
        String fileName = file.getOriginalFilename();
        //上传图片
        String newFileName = UUID.randomUUID() + fileName.substring(fileName.lastIndexOf("."));
        String avatars = "http://127.0.0.1:8088/basic/" + newFileName;
        cinema.setCover(avatars);
        try {
            File fileMkdir = new File("D:\\images\\basic");
            if (!fileMkdir.exists()) {
                fileMkdir.mkdir();
            }
            //定义输出流 将文件保存在D盘    file.getOriginalFilename()为获得文件的名字
            FileOutputStream os = new FileOutputStream(fileMkdir.getPath() + "\\" + newFileName);
            InputStream in = file.getInputStream();
            int b = 0;
            while ((b = in.read()) != -1) { //读取文件
                os.write(b);
            }
            os.flush(); //关闭流
            in.close();
            os.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
        cinemaService.insertCinema(cinema);
        responseResult.setMessage("添加成功");
        responseResult.setStatus(Constant.RESPONSE_STATUS_SUCCESS);
        return responseResult;
    }

    @RequestMapping("/cinema/{id}" )
    @ResponseBody
    public ResponseResult cinema(@PathVariable Integer id){
        ResponseResult responseResult = new ResponseResult();
        Cinema cinema = cinemaService.selectCinemaById1(id);
        responseResult.setMessage("查询成功");
        responseResult.setData(cinema);
        responseResult.setStatus(Constant.RESPONSE_STATUS_SUCCESS);
        return responseResult;
    }
    @ResponseBody
    @RequestMapping("/updateCinema")
    public ResponseResult updateCinema(HttpServletRequest request){
        MultipartResolver resolver = new CommonsMultipartResolver(request.getSession().getServletContext());
        MultipartHttpServletRequest mreq = resolver.resolveMultipart(request);
        Cinema cinema = new Cinema();
        ResponseResult responseResult = new ResponseResult();
        MultipartFile file = mreq.getFile("avatar");
        if(file!=null){
            String fileName = file.getOriginalFilename();
            //上传图片
            String newFileName = UUID.randomUUID() + fileName.substring(fileName.lastIndexOf("."));
            String avatars = "http://127.0.0.1:8088/basic/" + newFileName;
            cinema.setCover(avatars);
            try {
                File fileMkdir = new File("D:\\images\\basic");
                if (!fileMkdir.exists()) {
                    fileMkdir.mkdir();
                }
                //定义输出流 将文件保存在D盘    file.getOriginalFilename()为获得文件的名字
                FileOutputStream os = new FileOutputStream(fileMkdir.getPath() + "\\" + newFileName);
                InputStream in = file.getInputStream();
                int b = 0;
                while ((b = in.read()) != -1) { //读取文件
                    os.write(b);
                }
                os.flush(); //关闭流
                in.close();
                os.close();
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        String name = mreq.getParameter("name");
        cinema.setName(name);
        String type = mreq.getParameter("type");
        cinema.setType(type);
        Integer area = Integer.parseInt(mreq.getParameter("area"));
        cinema.setArea(area);
        Integer city = Integer.parseInt(mreq.getParameter("city"));
        cinema.setCitys(city);
        Integer brand = Integer.parseInt(mreq.getParameter("brand"));
        cinema.setBrand(brand);
        String time = mreq.getParameter("address");
        cinema.setAddress(time);
        String duration = mreq.getParameter("phone");
        cinema.setPhone(duration);
        Integer id = Integer.parseInt(mreq.getParameter("id"));
        cinema.setId(id);
        if(cinema.getCover()==null||cinema.getCover()==""){
            cinemaService.updateCinema1(cinema);
        }else{
            cinemaService.updateCinema(cinema);
        }
        responseResult.setMessage("添加成功");
        responseResult.setStatus(Constant.RESPONSE_STATUS_SUCCESS);
        return responseResult;
    }
    @RequestMapping("/session")
    public String session(Integer id,Model model){
        List<Movie> list1 = movieService.selectType1();
        ResponseResult responseResult = new ResponseResult();
        System.out.println(id);
        Date date = new Date();
        String str = "yyyy-MM-dd";
        SimpleDateFormat sdf = new SimpleDateFormat(str);
        String day = sdf.format(date);
        Session session = new Session();
        session.setDay(day);
        Cinema cinema1 = new Cinema();
        cinema1.setId(id);
        session.setCinema_id(cinema1);
        List<Session> list = cinemaService.findTodaySession(session);
        model.addAttribute("session",list);
        model.addAttribute("type",list1);
        responseResult.setData(list1);
        //responseResult.setData(list);
        return "session";
    }
    @ResponseBody
    @RequestMapping("/addSession")
    public ResponseResult addSession(Integer movie,double price,String time,Integer id){
        ResponseResult responseResult = new ResponseResult();
        Date date = new Date();
        String str = "yyyy-MM-dd";
        SimpleDateFormat sdf = new SimpleDateFormat(str);
        String day = sdf.format(date);
        Session session = new Session();
        session.setDay(day);
        session.setMovie(movie);
        session.setPrice(price);
        session.setTime(time);
        session.setCinema(id);
        cinemaService.insertSession(session);
        responseResult.setMessage("添加成功");
        responseResult.setStatus(Constant.RESPONSE_STATUS_SUCCESS);
        return responseResult;
    }
    @RequestMapping("/session/{id}" )
    @ResponseBody
    public ResponseResult sessions(@PathVariable Integer id){
        ResponseResult responseResult = new ResponseResult();
        Session session = cinemaService.selectSessionByIds(id);
        responseResult.setMessage("查询成功");
        responseResult.setData(session);
        responseResult.setStatus(Constant.RESPONSE_STATUS_SUCCESS);
        return responseResult;
    }
    @ResponseBody
    @RequestMapping("/updateSession")
    public ResponseResult updateSession(Integer movie,double price,String time,Integer id){
        ResponseResult responseResult = new ResponseResult();
        Date date = new Date();
        String str = "yyyy-MM-dd";
        SimpleDateFormat sdf = new SimpleDateFormat(str);
        String day = sdf.format(date);
        Session session = new Session();
        session.setDay(day);
        session.setMovie(movie);
        session.setPrice(price);
        session.setTime(time);
        session.setId(id);
        cinemaService.updateSession(session);
        responseResult.setMessage("添加成功");
        responseResult.setStatus(Constant.RESPONSE_STATUS_SUCCESS);
        return responseResult;
    }
}
